<template>
  <Teleport to="body">
    <div class="dialog" @click="setDialog">
      <h3>child组件</h3>
    </div>
  </Teleport>
</template>

<script>
export default {
  props: ['setDialog'],
  setup() {
    return {}
  }
}
</script>

<style lang="scss" scoped>
.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 20px;
}
</style>
